<template>
	<div class="hello">
		<el-row><el-button type="primary" @click="add()">添加</el-button></el-row>
		<company ref="company" @children="parentCompany"></company>
	</div>
</template>

<script>
// 导入组件company
import company from './company';

export default {
	name: 'HelloWorld',
	// 注册组件
	components: {
		company
	},
	data() {
		return {
			msg: 'Welcome to Your Vue.js App'
		};
	},
	methods: {
		add() {
			// 弹出对话框
			this.$refs.company.showDialog();
		},
		// 子组件传值给父组件-公司
		parentCompany(obj) {
			// 打印子组件传递的值
			console.log('parentCompany', obj);
		}
	}
};
</script>

<style scoped></style>
